USE [200Millas]
GO

/****** Object:  StoredProcedure [dbo].[usp_ConsultarBarco]    Script Date: 10/06/2012 01:16:00 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

create Procedure [dbo].[usp_ConsultarBarco] 
@vcod_bar char(3)
as
Select COD_BAR, NOM_BAR, FEC_COM, TIP_BAR, CAPACIDAD, FEC_ULT_MAN
from TB_BARCO
where COD_BAR=@vcod_bar
GO



USE [200Millas]
GO

/****** Object:  StoredProcedure [dbo].[usp_Listar_Barco]    Script Date: 10/06/2012 01:16:35 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE procedure [dbo].[usp_Listar_Barco]
as
SELECT COD_BAR, NOM_BAR, FEC_COM, TIP_BAR, CAPACIDAD, FEC_ULT_MAN FROM TB_BARCO
GO


USE [200Millas]
GO

/****** Object:  StoredProcedure [dbo].[usp_Listar_Faena]    Script Date: 10/06/2012 01:17:02 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE procedure [dbo].[usp_Listar_Faena]
as
SELECT 
	a.NUM_FAE, a.FEC_INI, a.FEC_FIN, a.ZON_MAR, a.COD_BAR, a.EST_FAE,
	b.NOM_BAR 
FROM 
	TB_FAENA a, TB_BARCO b
where
	a.COD_BAR = b.COD_BAR
GO


USE [200Millas]
GO

/****** Object:  StoredProcedure [dbo].[usp_Consultar_Faena]    Script Date: 10/06/2012 02:18:31 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

create procedure [dbo].[usp_Consultar_Faena]
@vnum_fae char(3)
as
SELECT 
	a.NUM_FAE, a.FEC_INI, a.FEC_FIN, a.ZON_MAR, a.COD_BAR, a.EST_FAE,
	b.NOM_BAR 
FROM 
	TB_FAENA a, TB_BARCO b
where
	a.COD_BAR = b.COD_BAR and a.NUM_FAE = @vnum_fae
GO


USE [200Millas]
GO

/****** Object:  StoredProcedure [dbo].[usp_Listar_Faena]    Script Date: 10/06/2012 02:18:59 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

create procedure [dbo].[usp_Listar_Faena]
as
SELECT 
	a.NUM_FAE, a.FEC_INI, a.FEC_FIN, a.ZON_MAR, a.COD_BAR, a.EST_FAE,
	b.NOM_BAR 
FROM 
	TB_FAENA a, TB_BARCO b
where
	a.COD_BAR = b.COD_BAR
GO


USE [200Millas]
GO

/****** Object:  StoredProcedure [dbo].[usp_ActualizarRecoleccion]    Script Date: 10/06/2012 03:06:10 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

create procedure [dbo].[usp_ActualizarRecoleccion]
@vnum_fae char(3),
@vcod_esp char(3),
@vcan_rec money
as
update TB_RECOLECCION set 
CAN_REC = @vcan_rec where NUM_FAE=@vnum_fae and COD_ESP = @vcod_esp
GO


USE [200Millas]
GO

/****** Object:  StoredProcedure [dbo].[usp_EliminarRecoleccion]    Script Date: 10/06/2012 03:06:31 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

create procedure [dbo].[usp_EliminarRecoleccion]
@vnum_fae char(3),
@vcod_esp char(3)
as
delete from TB_RECOLECCION where NUM_FAE=@vnum_fae and COD_ESP = @vcod_esp
GO


USE [200Millas]
GO

/****** Object:  StoredProcedure [dbo].[usp_InsertarRecoleccion]    Script Date: 10/06/2012 03:06:51 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


create procedure [dbo].[usp_InsertarRecoleccion]
@vnum_fae varchar(3),
@vcod_esp varchar(3),
@vcan_rec integer
AS
insert into TB_RECOLECCION 
values(@vnum_fae, @vcod_esp, @vcan_rec)

GO


USE [200Millas]
GO

/****** Object:  StoredProcedure [dbo].[usp_Listar_Recoleccion]    Script Date: 10/06/2012 03:07:08 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

create procedure [dbo].[usp_Listar_Recoleccion]
as
SELECT 
	a.NUM_FAE, a.COD_ESP, a.CAN_REC, 
	b.NOM_ESP 
FROM 
	TB_RECOLECCION a, TB_ESPECIE b
where
	a.COD_ESP = b.COD_ESP
GO


USE [200Millas]
GO

/****** Object:  StoredProcedure [dbo].[usp_Consultar_Recoleccion]    Script Date: 10/06/2012 03:07:24 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

create procedure [dbo].[usp_Consultar_Recoleccion]
@vnum_fae char(3),
@vcod_esp char(3)
as
SELECT 
	a.NUM_FAE, a.COD_ESP, a.CAN_REC, 
	b.NOM_ESP 
FROM 
	TB_RECOLECCION a, TB_ESPECIE b
where
	a.COD_ESP = b.COD_ESP and
	a.NUM_FAE=@vnum_fae and a.COD_ESP = @vcod_esp
GO


